package com.huike.game.dao;

import android.content.Context;

import com.huike.game.DbHelper.DataHelper;
import com.huike.game.base.Game15;
import com.j256.ormlite.dao.Dao;

import java.sql.SQLException;
import java.util.List;

public class AccountDao {

    private DataHelper helper;
    private Dao dao;

    public AccountDao(Context context) throws SQLException {
        helper  = DataHelper.getInstance(context);
        dao = helper.getDao(Game15.DataBean.class);

    }

    public void save(Game15.DataBean bean){
        try {
             dao.create(bean);
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }

    public List<Game15.DataBean> queryAll () throws SQLException {
        return dao.queryForAll();
    }

}
